from aiogram.types import Message
from aiogram.dispatcher import FSMContext


async def cancel_handler(message: Message, state: FSMContext):
    current_state = await state.get_state()

    if current_state is None:
        return await message.answer('Нечего отменять')

    await state.finish()
    await message.answer('Отменено')
